<template>
    <Menu theme="dark" :open-names="['1','2']" width="200">
        <Submenu name="1">
            <template slot="title">
                <Icon type="ios-paper"/>
                系统管理
            </template>
            <MenuItem name="1-1" to="/admin/system/user">用户管理</MenuItem>
            <MenuItem name="1-2" to="/admin/system/role">角色管理</MenuItem>
            <MenuItem name="1-3" to="/admin/system/node">菜单管理
            </MenuItem>
        </Submenu>
        <Submenu name="2">
            <template slot="title">
                <Icon type="ios-people"/>
                商品管理
            </template>
            <MenuItem name="2-1" to="/admin/goods/goodslist">商品列表</MenuItem>
            <MenuItem name="2-2" to="/admin/goods/goodscat">商品分类</MenuItem>
        </Submenu>
        <Submenu name="3">
            <template slot="title">
                <Icon type="ios-stats"/>
                统计分析
            </template>
            <MenuGroup title="使用">
                <MenuItem name="3-1">新增和启动</MenuItem>
                <MenuItem name="3-2">活跃分析</MenuItem>
                <MenuItem name="3-3">时段分析</MenuItem>
            </MenuGroup>
            <MenuGroup title="留存">
                <MenuItem name="3-4">用户留存</MenuItem>
                <MenuItem name="3-5">{{appName}}</MenuItem>
                <MenuItem name="3-6">{{userName}}</MenuItem>
            </MenuGroup>
        </Submenu>
    </Menu>
</template>
<script>
export default {
    name: 'HelloWorld',
    props: {
        msg: String,
    },
    data() {
        return {
            textmsg: "sdfgs时空来电飞机馆",
            list: {
                data: [
                    1, 2, 3, 5, 6, 8, 9, 5, 4, 21, 3, 5, 21, 3, 5, 1, 32, 54
                ],
                title: "dfgsd你回到",
                msg: 'fff',
                isman: true
            }
        }
    },
    computed:{
        appName(){
            return this.$store.state.appName;
        },
        userName(){
            return this.$store.state.user.userName;
        }
    },
    methods: {
        btn() {
            this.$emit('changeBtn', this.list);
            this.$busEvent.$emit('selectItem', this.list);

        }
    }
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="scss">
.menu-icon {
    transition: all .3s;
}
.rotate-icon {
    transform: rotate(-90deg);
}
.menu-item span {
    display: inline-block;
    overflow: hidden;
    width: 69px;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
    transition: width .2s ease .2s;
}
.menu-item i {
    transform: translateX(0px);
    transition: font-size .2s ease, transform .2s ease;
    vertical-align: middle;
    font-size: 16px;
}
.collapsed-menu span {
    width: 0px;
    transition: width .2s ease;
}
.collapsed-menu i {
    transform: translateX(5px);
    transition: font-size .2s ease .2s, transform .2s ease .2s;
    vertical-align: middle;
    font-size: 22px;
}
</style>
